using Circus.CodeEditor;

using System;
using System.ComponentModel;
namespace Circus.Syntax.CodeCompletion
{
	public class CodeSnippetReference : ICodeSnippetReference, IComparable
	{
		private string assembly = string.Empty;
		private string url = string.Empty;
		public virtual string Assembly
		{
			get
			{
				return this.assembly;
			}
			set
			{
				if (this.assembly != value)
				{
					this.assembly = value;
					this.OnAssemblyChanged();
				}
			}
		}
		public virtual string Url
		{
			get
			{
				return this.url;
			}
			set
			{
				if (this.url != value)
				{
					this.url = value;
					this.OnUrlChanged();
				}
			}
		}
	
		protected virtual void OnAssemblyChanged()
		{
		}
		protected virtual void OnUrlChanged()
		{
		}
		public virtual int CompareTo(object value)
		{
			if (value is ICodeSnippetReference)
			{
				return string.Compare(this.assembly, ((ICodeSnippetReference)value).Assembly, true);
			}
			throw new ArgumentException();
		}
	}
}
